<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ReflectionFunction 类</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="reflectionextension.tostring.html">« ReflectionExtension::__toString</a></li>
      <li style="float: right;"><a href="reflectionfunction.construct.html">ReflectionFunction::__construct »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.reflection.html">反射</a></li>
    <li>ReflectionFunction 类</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.reflectionfunction" class="reference">

 <h1 class="title">ReflectionFunction 类</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5, PHP 7, PHP 8)</p>


  <div class="section" id="reflectionfunction.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <span class="classname"><strong class="classname">ReflectionFunction</strong></span> 类报告有关函数的信息。
   </p>
  </div>


  <div class="section" id="reflectionfunction.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">ReflectionFunction</strong>
     </span>

     <span class="ooclass">
      <span class="modifier">extends</span>
       <a href="class.reflectionfunctionabstract.html" class="classname">ReflectionFunctionAbstract</a>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionfunction.html#reflectionfunction.constants.is-deprecated"><var class="varname">IS_DEPRECATED</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的属性 */</div>
    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="type">string</span>
      <var class="varname"><a href="class.reflectionfunctionabstract.html#reflectionfunctionabstract.props.name">$<var class="varname">name</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.closure.html" class="type Closure">Closure</a></span>|<span class="type">string</span></span> <code class="parameter">$function</code></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="reflectionfunction.export.html" class="methodname">export</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$return</code><span class="initializer"> = ?</span></span>): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.getclosure.html" class="methodname">getClosure</a></span>(): <span class="type"><a href="class.closure.html" class="type Closure">Closure</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.invoke.html" class="methodname">invoke</a></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">...$args</code></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.invokeargs.html" class="methodname">invokeArgs</a></span>(<span class="methodparam"><span class="type">array</span> <code class="parameter">$args</code></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.isanonymous.html" class="methodname">isAnonymous</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.isdisabled.html" class="methodname">isDisabled</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunction.tostring.html" class="methodname">__toString</a></span>(): <span class="type">string</span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">private</span> <span class="methodname"><a href="reflectionfunctionabstract.clone.html" class="methodname">ReflectionFunctionAbstract::__clone</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getattributes.html" class="methodname">ReflectionFunctionAbstract::getAttributes</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$name</code><span class="initializer"> = <strong><code>null</code></strong></span></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getclosurescopeclass.html" class="methodname">ReflectionFunctionAbstract::getClosureScopeClass</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.reflectionclass.html" class="type ReflectionClass">ReflectionClass</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getclosurethis.html" class="methodname">ReflectionFunctionAbstract::getClosureThis</a></span>(): <span class="type"><span class="type">?</span><span class="type">object</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getclosureusedvariables.html" class="methodname">ReflectionFunctionAbstract::getClosureUsedVariables</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getdoccomment.html" class="methodname">ReflectionFunctionAbstract::getDocComment</a></span>(): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getendline.html" class="methodname">ReflectionFunctionAbstract::getEndLine</a></span>(): <span class="type"><span class="type">int</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getextension.html" class="methodname">ReflectionFunctionAbstract::getExtension</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.reflectionextension.html" class="type ReflectionExtension">ReflectionExtension</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getextensionname.html" class="methodname">ReflectionFunctionAbstract::getExtensionName</a></span>(): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getfilename.html" class="methodname">ReflectionFunctionAbstract::getFileName</a></span>(): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getname.html" class="methodname">ReflectionFunctionAbstract::getName</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getnamespacename.html" class="methodname">ReflectionFunctionAbstract::getNamespaceName</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getnumberofparameters.html" class="methodname">ReflectionFunctionAbstract::getNumberOfParameters</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getnumberofrequiredparameters.html" class="methodname">ReflectionFunctionAbstract::getNumberOfRequiredParameters</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getparameters.html" class="methodname">ReflectionFunctionAbstract::getParameters</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getreturntype.html" class="methodname">ReflectionFunctionAbstract::getReturnType</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.reflectiontype.html" class="type ReflectionType">ReflectionType</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getshortname.html" class="methodname">ReflectionFunctionAbstract::getShortName</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getstartline.html" class="methodname">ReflectionFunctionAbstract::getStartLine</a></span>(): <span class="type"><span class="type">int</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.getstaticvariables.html" class="methodname">ReflectionFunctionAbstract::getStaticVariables</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.gettentativereturntype.html" class="methodname">ReflectionFunctionAbstract::getTentativeReturnType</a></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.reflectiontype.html" class="type ReflectionType">ReflectionType</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.hasreturntype.html" class="methodname">ReflectionFunctionAbstract::hasReturnType</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.hastentativereturntype.html" class="methodname">ReflectionFunctionAbstract::hasTentativeReturnType</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.innamespace.html" class="methodname">ReflectionFunctionAbstract::inNamespace</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.isclosure.html" class="methodname">ReflectionFunctionAbstract::isClosure</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.isdeprecated.html" class="methodname">ReflectionFunctionAbstract::isDeprecated</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.isgenerator.html" class="methodname">ReflectionFunctionAbstract::isGenerator</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.isinternal.html" class="methodname">ReflectionFunctionAbstract::isInternal</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.isuserdefined.html" class="methodname">ReflectionFunctionAbstract::isUserDefined</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.isvariadic.html" class="methodname">ReflectionFunctionAbstract::isVariadic</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.returnsreference.html" class="methodname">ReflectionFunctionAbstract::returnsReference</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><a href="reflectionfunctionabstract.tostring.html" class="methodname">ReflectionFunctionAbstract::__toString</a></span>(): <span class="type"><span class="type void">void</span></span></div>

   }</div>

  </div>
  

  <div class="section" id="reflectionfunction.constants">
   <h2 class="title">预定义常量</h2>
   <div class="section" id="reflectionfunction.constants.modifiers">
    <h2 class="title">ReflectionFunction 修饰符</h2>
    <dl>

     
      <dt id="reflectionfunction.constants.is-deprecated"><strong><code>ReflectionFunction::IS_DEPRECATED</code></strong></dt>

      <dd>

       <p class="para">
        表示弃用函数。
       </p>
      </dd>

     

    </dl>

   </div>
  </div>



 </div>

 




















































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionfunction.construct.html">ReflectionFunction::__construct</a> — Constructs a ReflectionFunction object</li><li><a href="reflectionfunction.export.html">ReflectionFunction::export</a> — Exports function</li><li><a href="reflectionfunction.getclosure.html">ReflectionFunction::getClosure</a> — Returns a dynamically created closure for the function</li><li><a href="reflectionfunction.invoke.html">ReflectionFunction::invoke</a> — Invokes function</li><li><a href="reflectionfunction.invokeargs.html">ReflectionFunction::invokeArgs</a> — Invokes function args</li><li><a href="reflectionfunction.isanonymous.html">ReflectionFunction::isAnonymous</a> — Checks if a function is anonymous</li><li><a href="reflectionfunction.isdisabled.html">ReflectionFunction::isDisabled</a> — Checks if function is disabled</li><li><a href="reflectionfunction.tostring.html">ReflectionFunction::__toString</a> — To string</li></ul>
</div>
</div></div></body></html>